# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntry do
  @moduledoc """
  A batch entry encoding a single non-batch accounts request.

  ## Attributes

  *   `account` (*type:* `GoogleApi.Content.V21.Model.Account.t`, *default:* `nil`) - The account to create or update. Only defined if the method is `insert` or `update`.
  *   `accountId` (*type:* `String.t`, *default:* `nil`) - The ID of the targeted account. Only defined if the method is not `insert`.
  *   `batchId` (*type:* `integer()`, *default:* `nil`) - An entry ID, unique within the batch request.
  *   `force` (*type:* `boolean()`, *default:* `nil`) - Whether the account should be deleted if the account has offers. Only applicable if the method is `delete`.
  *   `labelIds` (*type:* `list(String.t)`, *default:* `nil`) - Label IDs for the 'updatelabels' request.
  *   `linkRequest` (*type:* `GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntryLinkRequest.t`, *default:* `nil`) - Details about the `link` request.
  *   `merchantId` (*type:* `String.t`, *default:* `nil`) - The ID of the managing account.
  *   `method` (*type:* `String.t`, *default:* `nil`) - The method of the batch entry. Acceptable values are: - "`claimWebsite`" - "`delete`" - "`get`" - "`insert`" - "`link`" - "`update`" 
  *   `overwrite` (*type:* `boolean()`, *default:* `nil`) - Only applicable if the method is `claimwebsite`. Indicates whether or not to take the claim from another account in case there is a conflict.
  *   `view` (*type:* `String.t`, *default:* `nil`) - Controls which fields are visible. Only applicable if the method is 'get'.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :account => GoogleApi.Content.V21.Model.Account.t() | nil,
          :accountId => String.t() | nil,
          :batchId => integer() | nil,
          :force => boolean() | nil,
          :labelIds => list(String.t()) | nil,
          :linkRequest =>
            GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntryLinkRequest.t() | nil,
          :merchantId => String.t() | nil,
          :method => String.t() | nil,
          :overwrite => boolean() | nil,
          :view => String.t() | nil
        }

  field(:account, as: GoogleApi.Content.V21.Model.Account)
  field(:accountId)
  field(:batchId)
  field(:force)
  field(:labelIds, type: :list)
  field(:linkRequest, as: GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntryLinkRequest)
  field(:merchantId)
  field(:method)
  field(:overwrite)
  field(:view)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntry do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntry.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.AccountsCustomBatchRequestEntry do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
